﻿using UnityEngine;

public class Bullet : MonoBehaviour {
	// 子弹的移动速度
	public int speed = 10;

	// 从生成到消失经过时间
	public float lifeTime = 1;

	// 攻击力
	public int power = 1;

	void Start ( ) {
		// 朝上方向移动
		GetComponent<Rigidbody2D> ( ).velocity = transform.up.normalized * speed;

		// lifeTime秒后销毁
		Destroy (gameObject, lifeTime);
	}
}
